#coding:utf-8
"""
========================================
2.1.1.py
Author:Denhill
Date：2018.11.17
Site:Galaxy
Description:Matplotlib库入门练习
Status:unfinished
========================================
"""
#%%
import matplotlib.pyplot as plt

plt.plot([0,2,4,6,8],[3,1,4,5,2])
plt.ylabel('grade')
plt.axis([-1,10,0,6])
#plt.savefig('test',dpi=600)
plt.show()

#%%
import numpy as np
import matplotlib.pyplot as plt

def f(t):
    return np.exp(-t) * np.cos(2*np.pi*t)
a = np.arange(0.0,5.0,0.02)
plt.subplot(211)
plt.plot(a,f(a))

plt.subplot(2,1,2)
plt.plot(a,np.cos(2*np.pi*a),'r--')
plt.show()

#%%
import numpy as np
import matplotlib.pyplot as plt

a = np.arange(10)
plt.plot(a,a*1.5,'go-',a,a*2.5,'rx',a,a*3.5,'*',a,a*4.5,'b-.')
plt.show()

#%%
#中文显示：第一种方法
import matplotlib.pyplot as plt
import matplotlib

matplotlib.rcParams['font.family'] = 'SimHei'
plt.plot([3,1,4,5,2])
plt.ylabel('纵轴（值）')
plt.savefig('test',dpi=600)
plt.show()